package krakow.ae.knp.wikiboard.gui;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;

public class WikiboardFrame extends JFrame {
    
    private static final int WIDTH = 800, HEIGHT = 600;
    private GUI gui;
    
    public WikiboardFrame() {
        
        this.gui = new GUI();
        add(this.gui);
    }
    
    public static void main(String[] args) {
        
        run(new WikiboardFrame(), WIDTH, HEIGHT, "Wikiboard");
    }
    
    private static void run(final JFrame f, final int width, final int height,
            final String title) {
        
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                if (title.equals(""))
                    f.setTitle(f.getClass().getSimpleName());
                else
                    f.setTitle(title);
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                f.setSize(width, height);
                f.setVisible(true);
            }
        });
    }
}
